

.searchPage {
  height: 100vh;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  
  :global(.adm-nav-bar) {
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
  }
}

.searchContainer {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  background: #ffffff;
  border-bottom: 1px solid #f0f0f0;
}

.searchInputWrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #00CC66;
  border-radius: 20px;
  padding: 0 16px;
  height: 40px;
  box-shadow: none;
}

.searchIcon {
  color: #00CC66;
  font-size: 16px;
  margin-right: 8px;
}

.searchInput {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #333;
  
  :global(.adm-input) {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 14px;
    color: #333;
    
    &::placeholder {
      color: #999;
      font-size: 14px;
    }
  }
}

.clearIcon {
  color: #999;
  font-size: 16px;
  cursor: pointer;
  margin-left: 8px;
}

.searchBtn {
  background: transparent;
  color: #333;
  border: none;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  padding: 0;
  font-weight: 400;
  
  &:hover {
    color: #000;
  }
  
  &:disabled {
    color: #ccc;
    cursor: not-allowed;
  }
}

.searchContent {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.suggestImageContainer {
  width: 100%;
  margin-bottom: 12px;
  border-radius: 8px;
  overflow: hidden;
}

.suggestImage {
  width: 380px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

.loadingText {
  color: #666;
  font-size: 14px;
}

.resultItem {
  background: white;
  margin-bottom: 8px;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
  
  &:hover {
    background: #f8f9fa;
  }
}

.resultContent {
  display: flex;
  gap: 12px;
}

.resultImage {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.resultText {
  flex: 1;
  min-width: 0;
}

.resultTitle {
  font-size: 16px;
  font-weight: 600;
  color: #222;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.resultSummary {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.resultType {
  font-size: 12px;
  color: #1677ff;
  background: #e6f7ff;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-block;
}

.emptyState {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #999;
}

.emptyIcon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.emptyText {
  font-size: 16px;
}

// 搜索建议样式
.suggestionsContainer {
  background: white;
  border-radius: 8px;
  margin-bottom: 8px;
}

.suggestionItem {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.2s;
  
  &:last-child {
    border-bottom: none;
  }
  
  &:hover {
    background: #f8f9fa;
  }
}

.suggestionIcon {
  color: #999;
  font-size: 16px;
  margin-right: 12px;
}

.suggestionText {
  font-size: 14px;
  color: #333;
}

// 默认内容样式
.defaultContent {
  padding: 0;
}

// 历史搜索和热门搜索区域
.historySection,
.hotSection {
  background: white;
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 16px;
}

.sectionHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sectionTitle {
  font-size: 16px;
  font-weight: 600;
  color: #222;
}

.clearIcon,
.refreshIcon {
  color: #999;
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
  
  &:hover {
    color: #666;
  }
}

// 标签容器
.tagContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

// 搜索标签样式
.searchTag {
  background: #f5f5f5;
  color: #666;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  margin: 4px;
  display: inline-block;
  
  &:hover {
    background: #e8e8e8;
    color: #333;
  }
}
.searchTag{
  a{
     background: #f5f5f5;
  color: #666;
  text-decoration: none;
  }
}

// 热门标签特殊样式
.hotTag {
  background: #f5f5f5;
  color: #666;
  position: relative;
  
  &:hover {
    background: #e6f7ff;
    color: #1677ff;
  }
  
  // 特殊图标样式
  &.withIcon {
    &::before {
      content: '';
      display: inline-block;
      width: 12px;
      height: 12px;
      margin-right: 4px;
      vertical-align: middle;
    }
    
    &.chartIcon::before {
      background: #ff4d4f;
      border-radius: 2px;
    }
    
    &.pinIcon::before {
      background: #ff4d4f;
      border-radius: 50%;
    }
  }
}

// 标签图标
.tagIcon {
  margin-right: 4px;
  font-size: 12px;
}

// 标签图标图片
.tagIconImage {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  vertical-align: middle;
}

// HTML搜索结果样式
.htmlResultContainer {
  background: white;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

// 药品卡片横向滚动容器
.drugCardsContainer {
  background: white;
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 16px;
}

.drugCardsTitle {
  font-size: 16px;
  font-weight: 600;
  color: #222;
  margin-bottom: 12px;
}

.drugCardsScroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  
  // 隐藏滚动条但保持滚动功能
  scrollbar-width: none;
  -ms-overflow-style: none;
  
  &::-webkit-scrollbar {
    display: none;
  }
}

.drugCard {
  flex-shrink: 0;
  width: 280px;
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #f0f0f0;
}

.drugCardTitle {
  font-size: 18px;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
  line-height: 1.3;
}

.drugCardDescription {
  font-size: 14px;
  color: #666;
  margin-bottom: 16px;
  line-height: 1.4;
}

.drugCardTags {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.drugCardTag {
  background: #f5f5f5;
  color: #666;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  
  &:hover {
    background: #e8e8e8;
    color: #333;
  }
  
  &.active {
    background: #00CC66;
    color: white;
  }
}

.htmlResultHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.htmlResultHeader h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #222;
}

.openInNewWindow {
  background: #00CC66;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
  
  &:hover {
    background: #00b359;
  }
}

.htmlContent {
  max-height: 80vh;
  overflow-y: auto;
  padding: 0;
  font-size: 16px;
  
  // 重置春雨医生页面的样式，使其适配我们的布局
  :global {
    // 隐藏原有的导航和头部
    .container {
      padding: 0 !important;
      margin: 0 !important;
    }
    
    .input-section {
      display: none !important;
    }
    
    .search-tab-wrap {
      display: none !important;
    }
    
    // 调整内容区域样式
    .con-content {
      padding: 20px !important;
      background: white !important;
      font-size: 16px !important;
      line-height: 1.6 !important;
    }
    
    // 调整文章内容区域
    .article-content, .content, .main-content {
      padding: 20px !important;
      font-size: 16px !important;
      line-height: 1.8 !important;
      color: #333 !important;
    }
    
    // 调整标题样式，让它们更大更清晰
    h1, h2, h3, h4, h5, h6 {
      font-size: 18px !important;
      font-weight: 600 !important;
      color: #222 !important;
      margin: 20px 0 12px 0 !important;
      line-height: 1.4 !important;
    }
    
    // 调整段落样式
    p {
      font-size: 16px !important;
      line-height: 1.8 !important;
      color: #555 !important;
      margin: 12px 0 !important;
    }
    
    // 调整列表样式
    ul, ol {
      font-size: 16px !important;
      line-height: 1.8 !important;
      color: #555 !important;
      padding-left: 24px !important;
    }
    
    li {
      margin: 8px 0 !important;
    }
    
    // 调整卡片样式
    .baike-new-section,
    .goods-card,
    .consult,
    .recommend,
    .baike.doctor-topic,
    .science,
    .recommend_hospitals {
      margin-bottom: 16px !important;
      background: white !important;
      border-radius: 8px !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
      overflow: hidden !important;
    }
    
    // 调整标题样式
    .goods-big-title,
    .card_title,
    .search-title-name {
      font-size: 16px !important;
      font-weight: 600 !important;
      color: #222 !important;
      margin-bottom: 12px !important;
    }
    
    // 调整图片样式
    img {
      max-width: 100% !important;
      height: auto !important;
    }
    
    // 调整链接样式
    a {
      color: #00CC66 !important;
      text-decoration: none !important;
      
      &:hover {
        color: #00b359 !important;
      }
    }
    
    // 调整按钮样式
    button {
      background: #00CC66 !important;
      color: white !important;
      border: none !important;
      padding: 8px 16px !important;
      border-radius: 4px !important;
      cursor: pointer !important;
      
      &:hover {
        background: #00b359 !important;
      }
    }
    
    // 药品卡片横向滚动样式
    .medicine-cards, .drug-cards, .product-cards,
    [class*="medicine"][class*="card"], [class*="drug"][class*="card"] {
      display: flex !important;
      gap: 12px !important;
      overflow-x: auto !important;
      padding: 16px 0 !important;
      scrollbar-width: none !important;
      -ms-overflow-style: none !important;
      
      &::-webkit-scrollbar {
        display: none !important;
      }
      
      // 药品卡片子元素样式
      > div, > a, > li {
        flex-shrink: 0 !important;
        min-width: 280px !important;
        max-width: 280px !important;
        background: white !important;
        border-radius: 8px !important;
        padding: 16px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        border: 1px solid #f0f0f0 !important;
        margin-right: 12px !important;
      }
    }
    
    // 强制所有包含多个子div的容器横向滚动（除了明确排除的）
    div[style*="display: flex"], 
    div[style*="flex"], 
    .flex-container,
    .scroll-container,
    .goods-list,
    .product-list,
    .medicine-list {
      &:not(.goods-card):not(.baike-new-section):not(.recommend):not(.doctor-recommend):not(.product-recommend):not(.recommend_doctors):not(.recommend_products) {
        overflow-x: auto !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        
        &::-webkit-scrollbar {
          display: none !important;
        }
        
        // 子元素横向排列
        > * {
          flex-shrink: 0 !important;
          margin-right: 12px !important;
          min-width: 280px !important;
          max-width: 280px !important;
        }
      }
    }
    
    // 推荐商品和推荐医生区域 - 取消横向滚动，改为垂直布局
    .goods-card, .baike-new-section, .recommend,
    .doctor-recommend, .product-recommend,
    .recommend_doctors, .recommend_products {
      display: block !important;
      overflow: visible !important;
      
      // 子元素垂直排列
      > div, > a, > li {
        display: block !important;
        width: 100% !important;
        min-width: auto !important;
        max-width: none !important;
        margin-right: 0 !important;
        margin-bottom: 12px !important;
        background: white !important;
        border-radius: 8px !important;
        padding: 16px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        border: 1px solid #f0f0f0 !important;
      }
    }
    
    // 更通用的横向滚动容器检测
    div[style*="display: flex"], 
    div[style*="flex"], 
    .flex-container,
    .scroll-container,
    .goods-list,
    .product-list,
    .medicine-list {
      overflow-x: auto !important;
      scrollbar-width: none !important;
      -ms-overflow-style: none !important;
      
      &::-webkit-scrollbar {
        display: none !important;
      }
      
      // 子元素横向排列
      > * {
        flex-shrink: 0 !important;
        margin-right: 12px !important;
        min-width: 280px !important;
        max-width: 280px !important;
      }
    }
    
    // 针对可能的药品卡片特定样式
    .medicine-item, .drug-item, .product-item,
    [class*="medicine"], [class*="drug"], [class*="product"],
    .goods-item, .card-item {
      min-width: 280px !important;
      max-width: 280px !important;
      background: white !important;
      border-radius: 8px !important;
      padding: 16px !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
      border: 1px solid #f0f0f0 !important;
    }
  }
}

// 响应式设计
@media (min-width: 768px) {
  .searchContainer {
    max-width: 400px;
  }
  
  .resultImage {
    width: 80px;
    height: 80px;
  }
  
  .tagContainer {
    gap: 12px;
  }
  
  .searchTag {
    padding: 8px 16px;
    font-size: 15px;
  }
  
  .htmlContent {
    max-height: 90vh;
    font-size: 18px;
    
    :global {
      // 大屏幕上的字体更大
      h1, h2, h3, h4, h5, h6 {
        font-size: 20px !important;
      }
      
      p, li, span, div {
        font-size: 18px !important;
      }
      
      .con-content, .article-content, .content, .main-content {
        padding: 24px !important;
        font-size: 18px !important;
      }
    }
  }
}
